package com.ruoyi.common.utils.http;

import jakarta.servlet.http.HttpServletResponse;

import java.io.IOException;
import java.io.PrintWriter;

public class ResponseUtils {

    public static void writeMobileHtml(HttpServletResponse response, String message) throws IOException {
        response.setContentType("text/html; charset=UTF-8");
        PrintWriter out = response.getWriter();
        out.write(message);
        out.flush();
        out.close();
    }

    public static String mobileText(String message) {
        return """
                <!DOCTYPE html>
                  <html>
                  <head>
                      <meta charset="UTF-8">
                      <meta name="viewport" content="width=device-width, initial-scale=1.0">
                  </head>
                  <body>
                     """ + message + """
                  </body>
                </html>
                """;
    }

}
